<%@ include file="/WEB-INF/views/includes.jsp" %>
<%@ include file="/WEB-INF/views/header.jsp" %>
<%@ page session="false" %>


<h1>My Profile</h1>

<form name="profile" action="<c:url value='/profile'/>" method="POST" autocomplete = "off">

	<c:if test="${not empty message and not empty success}">
		<div style="<c:choose><c:when test="${success==true}">color:green;</c:when><c:otherwise>color:red;</c:otherwise></c:choose>">
			${message}
		</div>
	</c:if>
	
	<fieldset style="margin-top:30px;">
		<legend>User Information</legend>
		<table style="width:400px;border:none;" class="noborder">
			
			<tr>
				<td style="width:150px;">University ID:</td>
				<td style="width:250px;"><sec:authentication property="principal.username" /></td>
			</tr>
			
			<tr>
				<td>Name:</td>
				<td><sec:authentication property="principal.name" /></td>
			</tr>
		
		</table>
	</fieldset>
	
	<fieldset style="margin-top:30px;">
		<legend>Change Password</legend>
		<table style="width:400px;border:none;" class="noborder">
			<tr>
				<td style="width:150px;">Current Password:</td>
				<td style="width:250px;"><input type='password' name='oldPassword' /></td>
			</tr>
			
			<tr>
				<td>New Password:</td>
				<td><input type='password' name='newPassword'></td>
			</tr>
			<tr>
				<td colspan='2'>
					<input name="submit" type="submit" value="Update">&nbsp;
					<input name="cancel" type="button" value="Cancel" onClick="javascript:window.location.href='';">
				</td>
			</tr>
		</table>
		
	</fieldset>
	
</form>

<a href="<c:url value='/'/>">&laquo; Return to Previous View</a>

<%@ include file="/WEB-INF/views/footer.jsp" %>